#ifndef DRIVER_H_
#define DRIVER_H_

#include "ros/ros.h"

#include "std_msgs/String.h"
#include "geometry_msgs/Twist.h"

/**
 * Publishes movement operations for the robot's rover unit
 */
class Driver {

private:

	// ROS management objects
	geometry_msgs::Twist m_velCommand;
	ros::NodeHandle m_nodeHandler;
	ros::Publisher m_roverMdlPub;
	ros::Rate m_loop_rate;

	// current speed used for turn without changing speed
	double m_current_speed;

public:

	/**
	 * Constructor- creates a new driver object. \n
	 * Speed and direction are both set to 0
	 */
	Driver();

	/**
	 * Constructor- creates a new driver object
	 * @param speed default driving speed (meter/second)
	 * @param direction default angular speed (radian/second)
	 */
	Driver(double speed, double direction);

	/**
	 * Moves robot in given velocity (speed and direction). \n
	 * Default (linear) speed is set to be given speed value
	 * @param speed linear speed (meters/second)
     * @param direction angular speed (radian/second)
	 */
	void move(double speed, double direction);

	/**
	 * Moves the robot at given angular speed. \n
	 * Linear speed is driver's default speed
	 * @param direction default angular speed (radian/second)
	 */
	void turn(double direction);

	/**
	 * Stops the robot
	 */
	void stop();
};

#endif

